<?php
/**
 * Set configuration for Factory
 * NAME OF CONFIGURATION VARIABLES
 * 
 *
 *[conf_router]
 *default_module = xxx
 *default_controller = xxx
 *default_action = xxx
 *controller_singleton_action_name = xxx 
 *template_name = xxx
 *error_in_file = xxx
 *error_dir = xxx
 * 
 * @package Nucleo
 * @subpackage Nucleo.Configuration
 * @author Renan Henrique Abreu <renanhabreu@gmail.com>
 * @copyright 2009-2010 Renan Abreu
 */	
abstract class Nucleo_Configuration_Router implements Nucleo_Configuration{
	static private $configured = false;
	
	static public function setConfiguration($fileName){
	
		if(!self::$configured){
			if($configuration = parse_ini_file($fileName,TRUE)){
				$ROUTER_LIST = $configuration['conf_router'];
						
				if(isset($ROUTER_LIST)){
					foreach($ROUTER_LIST as $const=>$value)
						define(strtoupper($const),$value );																
				}else
					throw new Nucleo_Exception_Sifra('016',true);
					
				self::$configured = true;		
			}else{
				throw new Nucleo_Exception_Load('003');
			}
		}
	}
	
}
?>